
# 递归函数案例   函数自己调自己
# 求n的阶乘  n*n-1* ..4*3*2*1
result = 1
n = int(input("请输入一个数字"))
while n>=1:
    result *=  n
    n -= 1
print(result)

def diGui(n):
    if n >1:
        return n*diGui(n-1)
    else:
        return 1

print(diGui(7))

goodsList = [
        {"name":"快乐肥宅水","price":"3.0"},
        {"name":"茉莉清茶","price":"2.0"},
        {"name":"红茶","price":"4.0"}
        ]

def searchGoods(goodsName):
    for goods in goodsList:
        if goods["name"] == goodsName:
            return {"status":200,"msg":"商品存在","data":goods}

    return {"status":400,"msg":"商品不存在"}

print(searchGoods("绿茶"))

